package edu.ustb.efws.base.domain;

import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.Date;
import java.util.Objects;

/**
 * 传感器信息
 *
 * @author TS Group
 */
public class Detector {
    @ApiModelProperty("编号")
    private Integer id;
    @ApiModelProperty("传感器类型")
    private String detectorType;
    @ApiModelProperty("名称")
    private String description;
    @ApiModelProperty("位置")
    private String location;
    @ApiModelProperty("采集数据表名")
    private String tableName;
    @ApiModelProperty("是否采集数据")
    private Boolean collect;
    @ApiModelProperty("创建时间")
    private Date createTime;
    @ApiModelProperty("修改时间")
    private Date updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDetectorType() {
        return detectorType;
    }

    public void setDetectorType(String detectorType) {
        this.detectorType = detectorType;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Boolean getCollect() {
        return collect;
    }

    public void setCollect(Boolean collect) {
        this.collect = collect;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Detector detector = (Detector) o;
        return Objects.equals(id, detector.id) && Objects.equals(detectorType, detector.detectorType) && Objects.equals(description, detector.description) && Objects.equals(location, detector.location) && Objects.equals(tableName, detector.tableName) && Objects.equals(collect, detector.collect) && Objects.equals(createTime, detector.createTime) && Objects.equals(updateTime, detector.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, detectorType, description, location, tableName, collect, createTime, updateTime);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("detectorType", detectorType)
                .append("description", description)
                .append("location", location)
                .append("tableName", tableName)
                .append("collect", collect)
                .append("createTime", createTime)
                .append("updateTime", updateTime)
                .toString();
    }
}